package ink.feta.task.service;

import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.JobBriefInfo;

import java.util.Collection;


public interface ElasticJobService {
    /**
     * 创建Job
     *
     * @param configuration
     * @return
     */
    JobConfiguration createJob(JobConfiguration configuration);

    /**
     * 销毁作业
     *
     * @param jobName
     * @return
     */
    String deleteJob(String jobName);

    /**
     * 修改作业
     *
     * @param jobName
     * @param configuration
     * @return
     */
    JobConfiguration updateJob(String jobName, JobConfiguration configuration);

    /**
     * 作业列表
     *
     * @return
     */
    Collection<JobBriefInfo> listJobs();

    String pauseJob(String jobName);

    String resumeJob(String jobName);
}
